#ifndef DRAWWIDGET_H
#define DRAWWIDGET_H

#include <QWidget>
#include<QPen>
#include<QPainter>
#include<QPoint>
#include<QPixmap>
#include<QMouseEvent>
class drawwidget : public QWidget
{
    Q_OBJECT
public:
    explicit drawwidget(QWidget *parent = nullptr);


void mouseMoveEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);
void resizeEvent(QResizeEvent *event);


signals:

public slots:
void setWidth(int w);//设为槽函数的目的是为了后面通过按钮调用
void setStyle(int s);
void clearFun();
void setColor(QColor co);

private:
    QPoint startpos;
    QPixmap* pix;
    int mywidth,style;
    QColor color;
    QPainter * painter;


};

#endif // DRAWWIDGET_H
